package com.example.demo.Controller;


import com.example.demo.Model.User;
import com.example.demo.Service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Controller;

import javax.annotation.Resource;

@Controller
public class UserController {
    @Autowired
    private UserService userService;

    @Resource(name = "user2")
    private User user;

    public void sayHi() {
        System.out.println("hi UserController");
        userService.sayHi();
        System.out.println(user);
    }
}
